package com.chen.mapper;

import com.chen.pojo.Student;
import com.chen.pojo.StudentOption;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

@Mapper
public interface StudentMapper {

    List<Student> page(String name, Integer degree,Integer clazzId);

    void deleteByIds(List<Integer> ids);

    void add(Student student);

    @Select("select * from student where id=#{id}")
    Student getInfo(Integer id);

    void update(Student student);

    void updatescore(Integer id, Integer score);

    @MapKey("name")
    List<Map<String, Object>> countStudentDegreeData();

   List<Map<String,Object>> getStudentCountData();

    @Select("select count(*) from student where clazz_id=#{id} ")
    Integer countStudentByClassId(Integer id);
}
